﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FileProtector
{
    public partial class frmPassword : Form
    {
        public frmPassword()
        {
            InitializeComponent();
        }

        private void frmPassword_Load(object sender, EventArgs e)
        {

        }

        //Eneter Password
        private void btnPassword_Click(object sender, EventArgs e)
        {
            if (txtPassword.Text == "")
            {
                MessageBox.Show("Eneter Password", "No Password Found");
                return;
            }

            Libraries.SettingParams sp = new Libraries.SettingParams(System.IO.Path.GetDirectoryName(Application.ExecutablePath));
            if (string.IsNullOrEmpty(sp.VaultDirectory) || string.IsNullOrEmpty(sp.Password))
            {
                frmSettings frm = new frmSettings();
                frm.FirstTimeUser = true;
                frm.Show();
            }
            else
            {
                frmMain frm = new frmMain();
                frm.strPassword = txtPassword.Text;
                if(frm.ValidateCredential())
                    frm.Show();
            }
        }

       
    }
}
